<template>
  <div>

    <h2>state.count值: {{this.$store.state.count}}</h2>
    <button @click="increment"> +</button>
    <button @click="decrement"> -</button>
  </div>
</template>

<script>
  export default {
    name: "ReadState",
    data() {
      return {

      }
    },

    methods: {


      //此处执行的仅仅是commit操作，state中的状态并没有真正改变
      increment() {
        //提交mutation中的方法 和参数值
        this.$store.commit('increment' , 1)
      },
      decrement() {
        this.$store.commit('decrement', 1)
      },
    }
  }
</script>

<style scoped>

</style>
